package com.synnex.mobile.servier.core.contact.bo;

import com.synnex.mobile.generic.core.util.ObjectUtil;
import com.synnex.mobile.servier.core.contact.dto.Contact;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: kerryf
 * To change this template use File | Settings | File Templates.
 */
public class ContactBo {
    protected Integer id;
    protected String icon;
    protected String name;

    protected String company;
    protected String phone;

    protected Integer seq;
    protected Date entryDate;
    protected Date updateDate;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }


    public Integer getSeq() {
        return seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }

    public Date getEntryDate() {
        return entryDate;
    }

    public void setEntryDate(Date entryDate) {
        this.entryDate = entryDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public static ContactBo  createInstance(Contact record){

        if(record!=null){
            return ObjectUtil.copyProperties(record,ContactBo.class);
        }else{
            return new ContactBo();
        }
    }

    public static List<ContactBo> createInstance(List<Contact> records){

        List<ContactBo> contactBos = new ArrayList<ContactBo>();
        if (records != null) {
            for (Contact data : records) {
                contactBos.add(createInstance(data));
            }
        }
        return contactBos;
    }
}
